﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace GlassStore.Models
{
  [MetadataType(typeof(GlassMetaData))]
  public partial class Glass
  {
    [Bind(Exclude = "GlassId")]
    public class GlassMetaData
    {
      [ScaffoldColumn(true)]
      public object GlassId { get; set; }

      [Required(ErrorMessage = "名称不能为空")]
      [DisplayName("标题")]
      [StringLength(50, ErrorMessage = "名称最多50字符")]
      public object GlassName { get; set; }

      [DisplayName("品牌")]
      [StringLength(50, ErrorMessage = "品牌最多50字符")]
      public object Brand { get; set; }

      [DisplayName("材质")]
      [StringLength(50, ErrorMessage = "材质最多50字符")]
      public object Material { get; set; }

      [DisplayName("类别")]
      [StringLength(50, ErrorMessage = "类别最多50字符")]
      public object Style { get; set; }

      [DisplayName("类别详情")]
      [StringLength(50, ErrorMessage = "类别详情最多50字符")]
      public object StyleDetail { get; set; }

      [DisplayName("型号")]
      [StringLength(50, ErrorMessage = "型号最多50字符")]
      public object Serial { get; set; }

      [Required(ErrorMessage = "价格不能为空")]
      [DisplayName("价格")]
      [Range(0, double.MaxValue,ErrorMessage= "价格必须为正数")]
      public object Price { get; set; }

      [Required(ErrorMessage = "库存不能为空")]
      [DisplayName("库存")]
      [Range(0, int.MaxValue, ErrorMessage = "库存必须为正数")]
      public object Inventory { get; set; }

      [DisplayName("产品说明")]
      [StringLength(1024, ErrorMessage = "产品说明最多1024字符")]
      public object Description { get; set; }

      [DisplayName("缩略图(375*375)")]
      [StringLength(255)]
      public object Thumbnail { get; set; }

      [DisplayName("上架时间")]
      public object CreateTime { get; set; }

      [DisplayName("颜色")]
      [StringLength(50, ErrorMessage = "颜色最多50字符")]
      public object Color { get; set; }

      [DisplayName("尺寸")]
      [StringLength(50, ErrorMessage = "尺寸最多50字符")]
      public object Size { get; set; }

      [DisplayName("热销排行版")]
      [Range(0, 16, ErrorMessage = "请输入0-16，1在榜首，16在版尾，0不在排行板")]
      public object TopSale { get; set; }

      [DisplayName("新品排行版")]
      [Range(0, 16, ErrorMessage = "请输入0-16，1在榜首，16在版尾，0不在排行板")]
      public object TopNew { get; set; }

      [DisplayName("特价排行版")]
      [Range(0, 16, ErrorMessage = "请输入0-16，1在榜首，16在版尾，0不在排行板")]
      public object TopBargain { get; set; }
    }
  }
}